﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Spelprojekt.Model
{
    class Button
    {
        public Rectangle m_rectangle;
        public string m_text;

        public string m_command;

        enum ButtonState
        {
            Pressed,
            NotPressed,
            Locked
        }

        ButtonState m_buttonState = ButtonState.NotPressed;

        public Button(Rectangle a_rectangle, string a_text, string a_command)
        {
            m_rectangle = a_rectangle;
            m_text = a_text;
            m_command = a_command;
        }

        public void Click()
        {
            m_buttonState = ButtonState.Pressed;
        }

        public void UnClick()
        {
            m_buttonState = ButtonState.NotPressed;
        }

        public bool IsMouseOver(Vector2 a_mousePosition)
        {
            if (a_mousePosition.X > m_rectangle.Left
                && a_mousePosition.X < m_rectangle.Left + m_rectangle.Width
                 && a_mousePosition.Y > m_rectangle.Top
                  && a_mousePosition.Y < m_rectangle.Top + m_rectangle.Height)
            {
                return true;
            }

            return false;
        }
    }
}
